package k2_oop.p6_relation.demo06;

public class Driver {

    private String name;
    private String gender;
    private int age;

    public Driver(String name, String gender, int age) {
        this.name = name;
        this.gender = gender;
        this.age = age;
    }

    /**
     * 司机可以驾驶汽车，只有在开车的时候需要小汽车，所以是依赖关系
     * @param car
     */
    public void driveCar(Car car){
        System.out.println(this.name+"开着"+car.getPrice()+"价格的"+car.getBrand()+"的汽车");
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getGender() {
        return gender;
    }

    public void setGender(String gender) {
        this.gender = gender;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }
}
